
module hlsz {
    export class PlayMediatorHLSZ extends BaseMediator {
        public static NAME: string = "PlayMediatorHLSZ";

        public constructor(viewComponent: any = null) {
            super(PlayMediatorHLSZ.NAME, viewComponent);
        }
        public listNotificationInterests(): Array<any> {
            return [
                PanelNotify.HALL.STAGE_RESIZE,
                PanelNotify.HLSZ.OPEN_PLAY_GAME,
                PanelNotify.HLSZ.CLOSE_PLAY_GAME,
                PanelNotify.HLSZ.JOIN_ROOM,
                PanelNotify.HLSZ.START_GAME,
                PanelNotify.HLSZ.KAN_PAI,
                PanelNotify.HLSZ.QI_PAI,
                PanelNotify.HLSZ.BI_PAI,
                PanelNotify.HLSZ.GEN_ZHU,
                PanelNotify.HLSZ.GAME_OVER,
                PanelNotify.HLSZ.DATA_RECOVERY,
                PanelNotify.HLSZ.GET_SERIAL_NUMBER
            ]
        }
        public playPanel: PlayPanelHLSZ;//基础面板
        private bitImgArr = [];//下注筹码图片
        private timeOutArr = [];//自动退房倒计时
        //每个玩家的头像光圈倒计时
        private mask_0: egret.Shape;
        private maskTime_0;
        private mask_1: egret.Shape;
        private maskTime_1;
        private mask_2: egret.Shape;
        private maskTime_2;
        private mask_3: egret.Shape;
        private maskTime_3;
        private mask_4: egret.Shape;
        private maskTime_4;

        private NextGameTime = null;//下一局准备倒计时，10秒不准备自动退出房间
        //是否已勾选死跟到底
        private gendaodi: boolean = false;
        private bet_chip = [100, 1000, 5000, 10000, 50000];//筹码规格
        private fapaiXY = [
            { x: 320, y: 150 },
            { x: 320, y: 356 },
            { x: 578, y: 470 },
            { x: 850, y: 356 },
            { x: 850, y: 150 }];//0号到5号玩家的牌坐标  每1轮发牌X+50
        public handleNotification(notification: puremvc.INotification): void {
            switch (notification.getName()) {
                case PanelNotify.HALL.STAGE_RESIZE:
                    if (this.playPanel) {
                        this.playPanel.width = GameConfig.curWidth()
                        this.playPanel.height = GameConfig.curHeight()
                    }
                    break;
                case PanelNotify.HLSZ.CLOSE_PLAY_GAME:
                    this.destroy();
                    break;
                case PanelNotify.HLSZ.JOIN_ROOM:
                    if (this.playPanel && this.playPanel.parent) {
                        this.initUserInfo();
                    } else {//游戏中途加入有可能 先进玩家后加载房间数据，这时候面板还没起来。后台BUG
                        this.playPanel = null;
                        this.playPanel = new PlayPanelHLSZ();
                        this.showUI(this.playPanel, 2, 5);
                        game.AppFacade.instance.sendNotification(PanelNotify.HALL.JOIN_GAME_BY_HALL)
                    }
                    break;
                case PanelNotify.HLSZ.START_GAME:
                    this.clearData();
                    this.startGame();
                    break;
                case PanelNotify.HLSZ.KAN_PAI:
                    this.kanPaiReceive();
                    break;
                case PanelNotify.HLSZ.QI_PAI:
                    this.qiPaiaiReceive();
                    break;
                case PanelNotify.HLSZ.BI_PAI:
                    this.biPaiReceive()
                    break;
                case PanelNotify.HLSZ.GEN_ZHU:
                    this.genZhuReceive()
                    break;
                case PanelNotify.HLSZ.GAME_OVER:
                    this.gameOver();
                    break;
                case PanelNotify.HLSZ.DATA_RECOVERY:
                    this.dataRecovery();
                    break
                case PanelNotify.HLSZ.GET_SERIAL_NUMBER:
                    this.initRoomInfo();
                    break;
            }
        }

        /**
         * 初始化面板ui
         */
        public initUI(): void {
            //切换音乐
            if (InstructionsEnum.SOUND_GAME != InstructionsEnum.GAME_SOUND_NAME.HLSZ) {
                SoundManage.stopYinYue();
                InstructionsEnum.SOUND_GAME = InstructionsEnum.GAME_SOUND_NAME.HLSZ;
                SoundManage.startYinYueLoad();
            }
            //将滚动公告转移到当前面板
            EffectUtils.moveNoticeToPanel(this.playPanel.noticeGroup)
            this.playPanel.menu_button.addEventListener(egret.TouchEvent.TOUCH_TAP, this.menu_click, this)
            this.playPanel.menu_fankui.addEventListener(egret.TouchEvent.TOUCH_TAP, this.fankuiClick, this)
            this.playPanel.menu_jilu.addEventListener(egret.TouchEvent.TOUCH_TAP, this.jiluClick, this)
            this.playPanel.menu_exit.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onBackClick, this);
            this.playPanel.menu_help.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onHelpClick, this);
            this.playPanel.menu_set.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onSettingClick, this);

            this.playPanel.button_qipai.addEventListener(egret.TouchEvent.TOUCH_TAP, this.qiPaiSend, this);
            this.playPanel.button_kanpai.addEventListener(egret.TouchEvent.TOUCH_TAP, this.kanPaiSend, this);
            this.playPanel.button_bipai.addEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiClick, this);
            this.playPanel.button_genzhu.addEventListener(egret.TouchEvent.TOUCH_TAP, this.genZhuSend, this);
            this.playPanel.button_jiazhu.addEventListener(egret.TouchEvent.TOUCH_TAP, this.jiaZhuClick, this);
            this.playPanel.button_gendaodi.addEventListener(egret.TouchEvent.TOUCH_TAP, this.genDaoDiClick, this);
            this.playPanel.button_zhunbei.addEventListener(egret.TouchEvent.TOUCH_TAP, this.zhunbeiClick, this)
            // this.playPanel.button_huanzhuo.addEventListener(egret.TouchEvent.TOUCH_TAP, this.huanzhuoClick, this)
            this.fapaiXY = [
                { x: this.playPanel.chess_0_0.x, y: this.playPanel.chess_0_0.y },
                { x: this.playPanel.chess_1_0.x, y: this.playPanel.chess_1_0.y },
                { x: this.playPanel.chess_2_0.x, y: this.playPanel.chess_2_0.y },
                { x: this.playPanel.chess_3_0.x, y: this.playPanel.chess_3_0.y },
                { x: this.playPanel.chess_4_0.x, y: this.playPanel.chess_4_0.y },
            ];
        }
        /**
         * 初始化面板数据
         */
        public initData(): void {
            InstructionsEnum.isHall = true;
            this.clearData();
            this.initRoomInfo();
            this.initUserInfo();
        }
        //初始化数据
        private clearData() {
            //我的操作按钮
            this.gendaodi = false;
            this.playPanel.button_zhunbei.visible = false;
            // this.playPanel.button_huanzhuo.visible = false;

            this.playPanel.button_qipai.enabled = false;
            this.playPanel.button_kanpai.enabled = false;
            this.playPanel.button_bipai.enabled = false;
            this.playPanel.button_jiazhu.enabled = false;
            this.playPanel.button_genzhu.enabled = false;
            this.playPanel.button_gendaodi.enabled = false;
            this.playPanel.button_gendaodi2.visible = false;
            this.playPanel.jiazhuGroup.y = 750;
            this.playPanel.jiazhuGroup.alpha = 0;
            //牌局信息
            for (let i = 0; i < 5; i++) {
                for (let j = 0; j < 3; j++) {
                    this.playPanel["chess_" + i + "_" + j].scaleX = 1
                    this.playPanel["chess_" + i + "_" + j].source = "";
                    this.playPanel["chess_" + i + "_" + j].x = 667;
                    this.playPanel["chess_" + i + "_" + j].y = 330;
                }
            }
            for (let i = 0; i < 5; i++) {
                this.playPanel["chess_state_" + i].source = "";
                this.playPanel["chess_state_" + i].scaleX = 1;
                this.playPanel["chess_state_" + i].scaleY = 1;
            }
            for (let i = 0; i < 5; i++) {
                this.playPanel["chess_type_" + i].source = "";
                this.playPanel["chess_type_" + i].scaleX = 1;
                this.playPanel["chess_type_" + i].scaleY = 1;
            }
            for (let i = 0; i < 5; i++) {
                this.playPanel["xiazhu_" + i + "_bg"].visible = false;
            }
            for (let i = 0; i < 5; i++) {
                this.playPanel["xiazhu_" + i].text = "";
            }
            for (let i = 0; i < 5; i++) {
                this.playPanel["score_" + i].text = "";
            }
            for (let i = 0; i < 5; i++) {
                this.playPanel["timeout_" + i].visible = false
            }
            for (let i = 0; i < 5; i++) {
                this.playPanel["mask_" + i].visible = false
            }
            this.playPanel.xiazhu_all.text = "";
            this.playPanel.title.visible = false;
            for (let i = 0; i < this.playPanel.jinbi_group.numChildren; i++) {
                if (this.playPanel.jinbi_group.getChildAt(i) instanceof eui.Image) {
                    betImgPool.returnObject(<eui.Image>this.playPanel.jinbi_group.getChildAt(i))
                }
            }
            this.playPanel.jinbi_group.removeChildren();
        }
        //销毁UI
        public destroy(): void {
            InstructionsEnum.isHall = false;
            Global.removeTimeOut(this.timeOutArr);
            Global.removeTimeOut(InstructionsEnum.GAME_TIMEOUT_LIST)
            Global.removeInterval(InstructionsEnum.GAME_INTERVAL_LIST)
            this.NextGameTime = null;
            if (this.playPanel) {
                this.playPanel.timeout_2.destroy()
            }
            game.AppFacade.instance.sendNotification(PanelNotify.HALL.CLOSE_HELP);
            this.closePanel(1);
        }
        //初始化玩家信息
        private initUserInfo() {
            //玩家信息
            this.playPanel.userName_2.text = Global.cutString(GameVO.getVo().szNickName);
            this.playPanel.userMoney_2.text = HlszVO.getVo().lUserScore / 100 + "";
            this.playPanel.userImg_2.source = "special_" + GameVO.getVo().wFaceID % 15;
            if (HlszVO.getVo().wChairId_2 === HlszVO.getVo().wBankerUser) {
                this.playPanel.zhuang_2.visible = true;
            } else {
                this.playPanel.zhuang_2.visible = false;
            }
            if (HlszVO.getVo().status_2 === 2) {//未准备
                this.playPanel.button_zhunbei.visible = true;
                this.nextGameTimeout();
            } else {
                this.playPanel.button_zhunbei.visible = false;
            }
            if (HlszVO.getVo().status_2 === 3) {//已准备
                this.playPanel.ready_2.visible = true;
                Global.removeTimeOut(InstructionsEnum.GAME_TIMEOUT_LIST)
                this.NextGameTime = null;
                this.playPanel.timeout_2.destroy()
            } else {
                this.playPanel.ready_2.visible = false;
            }
            if (HlszVO.getVo().status_2 != 5 ||
                HlszVO.getVo().chess_state_2 == 3 ||
                HlszVO.getVo().chess_state_2 == 4) {//没处于游戏中都可以换桌
                // this.playPanel.button_huanzhuo.visible = true;
                // this.playPanel.button_huanzhuo.enabled = true
            }

            if (Global.isNotEmpty(HlszVO.getVo().wChairId_0)) {
                this.playPanel.userName_0.text = Global.cutString(HlszVO.getVo().userName_0);
                this.playPanel.userMoney_0.text = HlszVO.getVo().userMoney_0 / 100 + "";
                this.playPanel.userImg_0.source = "special_" + HlszVO.getVo().userImg_0 % 15;
                if (HlszVO.getVo().status_0 === 3) {//已准备
                    this.playPanel.ready_0.visible = true;
                } else {
                    this.playPanel.ready_0.visible = false;
                }
                if (HlszVO.getVo().wChairId_0 === HlszVO.getVo().wBankerUser) {
                    this.playPanel.zhuang_0.visible = true;
                } else {
                    this.playPanel.zhuang_0.visible = false;
                }
                this.playPanel.user_info_0.visible = true;
            } else {
                this.playPanel.user_info_0.visible = false;
            }

            if (Global.isNotEmpty(HlszVO.getVo().wChairId_1)) {
                this.playPanel.userName_1.text = Global.cutString(HlszVO.getVo().userName_1);
                this.playPanel.userMoney_1.text = HlszVO.getVo().userMoney_1 / 100 + "";
                this.playPanel.userImg_1.source = "special_" + HlszVO.getVo().userImg_1 % 15;
                if (HlszVO.getVo().status_1 === 3) {//已准备
                    this.playPanel.ready_1.visible = true;
                } else {
                    this.playPanel.ready_1.visible = false;
                }

                if (HlszVO.getVo().wChairId_1 === HlszVO.getVo().wBankerUser) {
                    this.playPanel.zhuang_1.visible = true;
                } else {
                    this.playPanel.zhuang_1.visible = false;
                }
                this.playPanel.user_info_1.visible = true;
            } else {
                this.playPanel.user_info_1.visible = false;
            }

            if (Global.isNotEmpty(HlszVO.getVo().wChairId_3)) {
                this.playPanel.userName_3.text = Global.cutString(HlszVO.getVo().userName_3);
                this.playPanel.userMoney_3.text = HlszVO.getVo().userMoney_3 / 100 + "";
                this.playPanel.userImg_3.source = "special_" + HlszVO.getVo().userImg_3 % 15;
                if (HlszVO.getVo().status_3 === 3) {//已准备
                    this.playPanel.ready_3.visible = true;
                } else {
                    this.playPanel.ready_3.visible = false;
                }

                if (HlszVO.getVo().wChairId_3 === HlszVO.getVo().wBankerUser) {
                    this.playPanel.zhuang_3.visible = true;
                } else {
                    this.playPanel.zhuang_3.visible = false;
                }
                this.playPanel.user_info_3.visible = true;
            } else {
                this.playPanel.user_info_3.visible = false;
            }

            if (Global.isNotEmpty(HlszVO.getVo().wChairId_4)) {
                this.playPanel.userName_4.text = Global.cutString(HlszVO.getVo().userName_4);
                this.playPanel.userMoney_4.text = HlszVO.getVo().userMoney_4 / 100 + "";
                this.playPanel.userImg_4.source = "special_" + HlszVO.getVo().userImg_4 % 15;
                if (HlszVO.getVo().status_4 === 3) {//已准备
                    this.playPanel.ready_4.visible = true;
                } else {
                    this.playPanel.ready_4.visible = false;
                }

                if (HlszVO.getVo().wChairId_4 === HlszVO.getVo().wBankerUser) {
                    this.playPanel.zhuang_4.visible = true;
                } else {
                    this.playPanel.zhuang_4.visible = false;
                }
                this.playPanel.user_info_4.visible = true;
            } else {
                this.playPanel.user_info_4.visible = false;
            }
        }
        // 初始化房间信息
        private initRoomInfo() {
            this.playPanel.dizhu.text = "底注：" + HlszVO.getVo().lCellScore / 100;
            this.playPanel.lunshu.text = "轮数：" + HlszVO.getVo().wTurnCount + "/20";
            this.playPanel.bianhao.text = "局号：" + HlszVO.getVo().gameNumbering;
            this.playPanel.xiazhu_all.text = "奖池：" + HlszVO.getVo().xiazhuNum_ALL / 100
            this.playPanel.danzhu.text = "单注：" + HlszVO.getVo().lCellScore / 100 * HlszVO.getVo().lCurrentTimes;
        }
        //准备
        private zhunbeiClick(eve: egret.TouchEvent) {
            SoundManage.startAnniuBtnLoad();
            SocketManager.sendMessage(InstructionsEnum.GAME_TYPE_NAME.HLSZ, RegDataHlsz.CMD_GP_StartGame, {});
        }
        //换桌
        private huanzhuoClick(eve: egret.TouchEvent) {
            SoundManage.startAnniuBtnLoad();
            HlszVO.getVo().huanzhuoClick = true;
            // this.playPanel.button_huanzhuo.enabled = false
            this.playPanel.timeout_0.destroy()
            this.playPanel.timeout_1.destroy()
            this.playPanel.timeout_3.destroy()
            this.playPanel.timeout_4.destroy()
            SocketManager.sendMessage(InstructionsEnum.GAME_TYPE_NAME.HLSZ, RegDataHlsz.CMD_GP_ModifyRoom, {});
        }
        //弃牌发送
        private qiPaiSend(eve: egret.TouchEvent) {
            SoundManage.startAnniuBtnLoad();
            SocketManager.sendMessage(InstructionsEnum.GAME_TYPE_NAME.HLSZ, RegDataHlsz.CMD_GP_GiveUp, {});
        }
        //看牌发送
        private kanPaiSend(eve: egret.TouchEvent) {
            SoundManage.startAnniuBtnLoad();
            SocketManager.sendMessage(InstructionsEnum.GAME_TYPE_NAME.HLSZ, RegDataHlsz.CMD_GP_LookCard, {});
        }
        //比牌点击选人
        private biPaiClick(eve: egret.TouchEvent) {
            SoundManage.startAnniuBtnLoad();
            this.biPaiClose();
            let arr = [];
            if (Global.isNotEmpty(HlszVO.getVo().wChairId_0) && (HlszVO.getVo().chess_state_0 == 2 || HlszVO.getVo().chess_state_0 == 1)) {
                arr.push(HlszVO.getVo().wChairId_0);
                EffectUtils.Twinkle(this.playPanel.userImg_0, -1)
                this.playPanel.userImg_0.addEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiSend, this)
            }
            if (Global.isNotEmpty(HlszVO.getVo().wChairId_1) && (HlszVO.getVo().chess_state_1 == 2 || HlszVO.getVo().chess_state_1 == 1)) {
                arr.push(HlszVO.getVo().wChairId_1);
                EffectUtils.Twinkle(this.playPanel.userImg_1, -1)
                this.playPanel.userImg_1.addEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiSend, this)
            }
            if (Global.isNotEmpty(HlszVO.getVo().wChairId_3) && (HlszVO.getVo().chess_state_3 == 2 || HlszVO.getVo().chess_state_3 == 1)) {
                arr.push(HlszVO.getVo().wChairId_3);
                EffectUtils.Twinkle(this.playPanel.userImg_3, -1)
                this.playPanel.userImg_3.addEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiSend, this)
            }
            if (Global.isNotEmpty(HlszVO.getVo().wChairId_4) && (HlszVO.getVo().chess_state_4 == 2 || HlszVO.getVo().chess_state_4 == 1)) {
                arr.push(HlszVO.getVo().wChairId_4);
                EffectUtils.Twinkle(this.playPanel.userImg_4, -1)
                this.playPanel.userImg_4.addEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiSend, this);
            }
            this.playPanel.title.visible = true;
            this.playPanel.addEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiClose, this);
            eve.stopPropagation()
            if (arr.length == 1) {//只剩一个对手不用选了直接比牌
                this.biPaiClose();
                HlszVO.getVo().mySelectUser = arr[0];
                let num = HlszVO.getVo().lCellScore * HlszVO.getVo().lCurrentTimes
                if (HlszVO.getVo().chess_state_2 == 2) {
                    num = num * 2
                }
                let obj = {
                    lScore: num,						//下注数目
                    wState: 1,							//1-比牌下注 0-普通下注
                    keyToken: ""                     //密文
                }
                SocketManager.sendMessage(InstructionsEnum.GAME_TYPE_NAME.HLSZ, RegDataHlsz.CMD_GP_AddScore, obj);
            }

        }
        //关闭比牌选人
        private biPaiClose() {
            this.playPanel.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiClose, this);
            this.playPanel.title.visible = false;
            egret.Tween.removeTweens(this.playPanel.userImg_0)
            this.playPanel.userImg_0.alpha = 1;
            this.playPanel.userImg_0.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiSend, this)
            egret.Tween.removeTweens(this.playPanel.userImg_1)
            this.playPanel.userImg_1.alpha = 1;
            this.playPanel.userImg_1.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiSend, this)
            egret.Tween.removeTweens(this.playPanel.userImg_3)
            this.playPanel.userImg_3.alpha = 1;
            this.playPanel.userImg_3.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiSend, this)
            egret.Tween.removeTweens(this.playPanel.userImg_4)
            this.playPanel.userImg_4.alpha = 1;
            this.playPanel.userImg_4.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiSend, this)
        }
        //比牌发送
        private biPaiSend(eve: egret.TouchEvent) { //若用户迟迟不选择比牌对象，则后台自动弃牌后回来调这里关闭动画
            this.biPaiClose();
            eve.stopPropagation()
            if (eve.currentTarget == this.playPanel.userImg_0) {
                HlszVO.getVo().mySelectUser = HlszVO.getVo().wChairId_0
            }
            if (eve.currentTarget == this.playPanel.userImg_1) {
                HlszVO.getVo().mySelectUser = HlszVO.getVo().wChairId_1
            }
            if (eve.currentTarget == this.playPanel.userImg_3) {
                HlszVO.getVo().mySelectUser = HlszVO.getVo().wChairId_3
            }
            if (eve.currentTarget == this.playPanel.userImg_4) {
                HlszVO.getVo().mySelectUser = HlszVO.getVo().wChairId_4
            }
            let num = HlszVO.getVo().lCellScore * HlszVO.getVo().lCurrentTimes
            if (HlszVO.getVo().chess_state_2 == 2) {
                num = num * 2
            }
            let obj = {
                lScore: num,						//下注数目
                wState: 1,							//1-比牌下注 0-普通下注
                keyToken: ""                     //密文
            }
            SocketManager.sendMessage(InstructionsEnum.GAME_TYPE_NAME.HLSZ, RegDataHlsz.CMD_GP_AddScore, obj);
        }
        //跟注发送
        private genZhuSend() {
            SoundManage.startAnniuBtnLoad();
            let num = HlszVO.getVo().lCellScore * HlszVO.getVo().lCurrentTimes
            if (HlszVO.getVo().chess_state_2 == 2) {
                num = num * 2
            }
            let obj = {
                lScore: num,						//下注数目
                wState: 0,							//1-比牌下注 0-普通下注
                keyToken: ""                     //密文
            }
            SocketManager.sendMessage(InstructionsEnum.GAME_TYPE_NAME.HLSZ, RegDataHlsz.CMD_GP_AddScore, obj);
        }
        //加注点击选筹码
        private jiaZhuClick(eve: egret.TouchEvent) {
            SoundManage.startAnniuBtnLoad();
            this.refreshJiaZhu(true);
        }
        //显示加注按钮
        private refreshJiaZhu(open: boolean = false) {//打开或关闭
            if (open) {
                //根据当前底注更新那些按钮可点击
                let zudia = HlszVO.getVo().lMaxScore / 100;
                let beishu = HlszVO.getVo().lCurrentTimes;
                let dangqian = HlszVO.getVo().lCellScore;
                this.playPanel.jiazhu4.enabled = false;
                this.playPanel.jiazhu3.enabled = false;
                this.playPanel.jiazhu2.enabled = false
                this.playPanel.jiazhu1.enabled = false
                this.playPanel.jiazhu0.enabled = false
                this.playPanel.jiazhu4.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.jiaZhuSend, this);
                this.playPanel.jiazhu3.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.jiaZhuSend, this);
                this.playPanel.jiazhu2.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.jiaZhuSend, this);
                this.playPanel.jiazhu1.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.jiaZhuSend, this);
                this.playPanel.jiazhu0.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.jiaZhuSend, this);
                this.playPanel.jiazhu4.label = zudia + "";
                this.playPanel.jiazhu3.label = zudia * (8 / 10) + "";
                this.playPanel.jiazhu2.label = zudia * (6 / 10) + "";
                this.playPanel.jiazhu1.label = zudia * (4 / 10) + "";
                this.playPanel.jiazhu0.label = zudia * (2 / 10) + "";
                if (beishu < 10) {
                    this.playPanel.jiazhu4.enabled = true
                    this.playPanel.jiazhu4.addEventListener(egret.TouchEvent.TOUCH_TAP, this.jiaZhuSend, this);
                }
                if (beishu < 8) {
                    this.playPanel.jiazhu3.enabled = true
                    this.playPanel.jiazhu3.addEventListener(egret.TouchEvent.TOUCH_TAP, this.jiaZhuSend, this);
                }
                if (beishu < 6) {
                    this.playPanel.jiazhu2.enabled = true
                    this.playPanel.jiazhu2.addEventListener(egret.TouchEvent.TOUCH_TAP, this.jiaZhuSend, this);
                }
                if (beishu < 4) {
                    this.playPanel.jiazhu1.enabled = true
                    this.playPanel.jiazhu1.addEventListener(egret.TouchEvent.TOUCH_TAP, this.jiaZhuSend, this);
                }
                if (beishu < 2) {
                    this.playPanel.jiazhu0.enabled = true
                    this.playPanel.jiazhu0.addEventListener(egret.TouchEvent.TOUCH_TAP, this.jiaZhuSend, this);
                }
                if (this.playPanel.jiazhuGroup.y != 520) {
                    egret.Tween.get(this.playPanel.jiazhuGroup).to({ y: 520, alpha: 1 }, 300, egret.Ease.circOut);
                }
            } else {
                if (this.playPanel.jiazhuGroup.y != 750) {
                    egret.Tween.get(this.playPanel.jiazhuGroup).to({ y: 750, alpha: 0 }, 300);
                }
            }
        }
        //加注发送
        private jiaZhuSend(eve: egret.TouchEvent) {
            SoundManage.startAnniuBtnLoad();
            let button: eui.Button = eve.currentTarget;
            let num = Number(button.label) * 100;
            if (HlszVO.getVo().chess_state_2 == 2) {
                num = num * 2
            }
            let obj = {
                lScore: num,						//下注数目
                wState: 0,							//1-比牌下注 0-普通下注
                keyToken: ""                     //密文
            }
            SocketManager.sendMessage(InstructionsEnum.GAME_TYPE_NAME.HLSZ, RegDataHlsz.CMD_GP_AddScore, obj);
        }
        //选择死跟到底
        private genDaoDiClick(eve: egret.TouchEvent) {
            SoundManage.startAnniuBtnLoad();
            if (this.gendaodi) {
                this.gendaodi = false;
                this.playPanel.button_gendaodi2.visible = false;
            } else {
                this.gendaodi = true;
                this.playPanel.button_gendaodi2.visible = true;
                //点击跟到底的时候如果该我说话，自动发跟注
                if (HlszVO.getVo().wCurrentUser == HlszVO.getVo().wChairId_2) {
                    this.genZhuSend();
                }
            }
        }
        //游戏开始发牌
        private startGame() {
            this.playPanel.button_bipai.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.kaipai, this);
            this.playPanel.button_bipai.addEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiClick, this);
            Global.removeTimeOut(InstructionsEnum.GAME_TIMEOUT_LIST)
            this.NextGameTime = null;
            this.playPanel.timeout_2.destroy()
            this.initUserInfo();//开局扣钱后刷新玩家金币
            this.initRoomInfo();//更新底注和轮数
            SoundManage.startYinxiaoLoad("hlsz_start_mp3");
            this.playPanel.setChildIndex(this.playPanel.jinbi_group, this.playPanel.getChildIndex(this.playPanel.chess_group))
            //统计出当前有几个人，谁是庄，应该从庄轮流发
            let zhuang = null;//庄家座位号(前端皮肤上的座位号。不是后端提供的座位号。把后端座位转换为前端的座位确定发牌顺序)
            let userArr = [];//每个人的座位号
            let fapaiArr = [];//发牌的座位顺序 若userArr =【0,1,2,3,4】 而庄为2，则fapaiArr为【2,3,4,0,1,】

            if (Global.isNotEmpty(HlszVO.getVo().wChairId_0)) {
                userArr.push(0);
                this.genZhuReceive(0, HlszVO.getVo().xiaZhuNum_0)
                if (HlszVO.getVo().wChairId_0 == HlszVO.getVo().wBankerUser) {
                    zhuang = 0;
                    EffectUtils.Twinkle(this.playPanel.zhuang_0);   //发牌给庄家闪烁提示
                }
            }
            if (Global.isNotEmpty(HlszVO.getVo().wChairId_1)) {
                userArr.push(1);
                this.genZhuReceive(1, HlszVO.getVo().xiaZhuNum_1)
                if (HlszVO.getVo().wChairId_1 == HlszVO.getVo().wBankerUser) {
                    zhuang = 1;
                    EffectUtils.Twinkle(this.playPanel.zhuang_1);
                }
            }
            if (Global.isNotEmpty(HlszVO.getVo().wChairId_2)) {
                userArr.push(2);
                this.genZhuReceive(2, HlszVO.getVo().xiaZhuNum_2)
                if (HlszVO.getVo().wChairId_2 == HlszVO.getVo().wBankerUser) {
                    zhuang = 2;
                    EffectUtils.Twinkle(this.playPanel.zhuang_2);
                }
            }
            if (Global.isNotEmpty(HlszVO.getVo().wChairId_3)) {
                userArr.push(3);
                this.genZhuReceive(3, HlszVO.getVo().xiaZhuNum_3)
                if (HlszVO.getVo().wChairId_3 == HlszVO.getVo().wBankerUser) {
                    zhuang = 3;
                    EffectUtils.Twinkle(this.playPanel.zhuang_3);
                }
            }
            if (Global.isNotEmpty(HlszVO.getVo().wChairId_4)) {
                userArr.push(4);
                this.genZhuReceive(4, HlszVO.getVo().xiaZhuNum_4)
                if (HlszVO.getVo().wChairId_4 == HlszVO.getVo().wBankerUser) {
                    zhuang = 4;
                    EffectUtils.Twinkle(this.playPanel.zhuang_4);
                }
            }
            //把庄调到发牌数组首位
            if (userArr.indexOf(zhuang) != -1) {
                fapaiArr = userArr.slice(userArr.indexOf(zhuang));//从庄开始截取到最后
                fapaiArr = fapaiArr.concat(userArr.slice(0, userArr.indexOf(zhuang)));//前面剩余的从0截取到庄
            } else {
                Global.tipShow("数据错误！无庄家ID无法发牌");
                return;
            }
            var t = egret.setTimeout(() => {
                //每人发3张牌
                let chessNum = fapaiArr.length * 3;
                let j = 0;//发到第几轮了
                var t2 = egret.setInterval(() => {
                    for (let i in fapaiArr) {
                        let img: eui.Image = this.playPanel["chess_" + fapaiArr[i] + "_" + j];
                        img.source = "hlzs_pokerBG";
                        egret.Tween.get(img).to({ x: this.fapaiXY[fapaiArr[i]].x + j * 50, y: this.fapaiXY[fapaiArr[i]].y }, 200).call((img: eui.Image) => {
                            egret.Tween.removeTweens(img);
                        }, this, [img]);
                    }
                    SoundManage.startYinxiaoLoad("hlsz_card_mp3");
                    j++;
                    if (j >= 3) {
                        egret.clearInterval(t2);
                        //牌发完了，该谁说话？
                        this.showMask(HlszVO.getVo().wCurrentUser, HlszVO.getVo().cbTimeOutCard);
                        this.refreshMyButton();
                        let t3 = egret.setTimeout(() => {
                            this.playPanel.setChildIndex(this.playPanel.chess_group, this.playPanel.getChildIndex(this.playPanel.jinbi_group))
                            egret.clearInterval(t3);
                        }, this, 1000)
                        return;
                    }
                }, this, 200)
                egret.clearTimeout(t)
            }, this, 300)
        }
        //弃牌返回
        private qiPaiaiReceive() {
            let sort = HlszVO.getVo().qiPaiUser;
            if (sort == 2) {
                this.playPanel.chess_type_2.source = "";//我输牌或者棋牌可能时先看了牌，把牌型清除图片
            }
            //玩家牌状态
            if (this.playPanel["chess_" + sort + "_0"].source == "hlzs_pokerBG") {
                for (let i = 0; i < 3; i++) {
                    this.playPanel["chess_" + sort + "_" + i].source = "hlzs_pokerBG_h";
                }
            }
            this.playPanel["chess_state_" + sort].source = "hlzs_state_qipai";
            EffectUtils.shakeObj(this.playPanel["chess_state_" + sort])
            this.playPanel["mask_" + sort].visible = true;
            SoundManage.startYinxiaoLoad("hlsz_qipai_" + Global.getRandom(0, 4) + "_mp3");
            /*
            我的比牌选人界面有可能已经打开
            如果该我说话，别人弃牌要关闭我的比牌界面
            如果我迟迟不选择，后台托管给我弃牌，我变成了wOutCardUser，也要关闭我的比牌界面
            如果我选择了跟注或者看牌等其他操作，则当时全屏点击事件会关闭选人界面
            */
            if (HlszVO.getVo().wCurrentUser == HlszVO.getVo().wChairId_2 ||
                HlszVO.getVo().wOutCardUser == HlszVO.getVo().wChairId_2　) {
                this.biPaiClose();
            }
            this.refreshMyButton();
            this.hideMask(HlszVO.getVo().wOutCardUser)
            // this.showMask(HlszVO.getVo().wCurrentUser, HlszVO.getVo().cbTimeOutCard)
        }
        //看牌返回
        private kanPaiReceive() {
            let sort = HlszVO.getVo().kanPaiser;
            if (sort == 2) {
                let cbCardData: Array<any> = HlszVO.getVo().cbCardDataALL[HlszVO.getVo().wChairId_2];
                let cbCardType_my = HlszVO.getVo().cbCardType_my
                if (Global.isNotEmpty(cbCardData)) {
                    for (let i = 0; i < 3; i++) {
                        EffectUtils.xuanZuanHuanTu(this.playPanel["chess_" + sort + "_" + i], Global.getPokerById(cbCardData[i]))
                    }
                }
                if (Global.isNotEmpty(cbCardType_my)) {
                    this.playPanel.chess_type_2.source = cbCardType_my == 7 ? "hlzs_cardtype1" : "hlzs_cardtype" + cbCardType_my;
                }
            } else {
                //玩家牌状态
                this.playPanel["chess_state_" + sort].source = "hlzs_state_kanpai";
                EffectUtils.Stretch(this.playPanel["chess_state_" + sort])
            }
            SoundManage.startYinxiaoLoad("hlsz_kanpai_" + Global.getRandom(0, 2) + "_mp3");
            this.refreshMyButton();
        }
        //比牌返回
        private biPaiReceive() {
            var paiUser1 = HlszVO.getVo().biPaiUser;
            var paiUser2 = HlszVO.getVo().biPaiUser2
            var loseUser = HlszVO.getVo().shupaiUser;
            var thisBack = this;
            //比牌动画start
            this.playPanel.bipai_state_left.source = "hlzs_haopai"
            this.playPanel.bipai_state_right.source = "hlzs_haopai"
            thisBack.playPanel.bipai_left.x = - thisBack.playPanel.bipai_left.width
            thisBack.playPanel.bipai_right.x = GameConfig.curWidth();

            let leftX1 = GameConfig.curWidth() / 2 - 380;
            let leftY1 = GameConfig.curHeight() / 2 - 50
            let rightX1 = GameConfig.curWidth() / 2 + 280;
            let rightY1 = GameConfig.curHeight() / 2 + 20

            let bipai_left_x = (GameConfig.curWidth() / 2) - (this.playPanel.bipai_left.width)
            let bipai_right_x = (GameConfig.curWidth() / 2) - 200;

            if (paiUser1 == 0) {
                this.playPanel.bipai_img_left.source = "special_" + HlszVO.getVo().userImg_0 % 15;
                this.playPanel.bipai_img_left.x = this.playPanel.user_info_0.x + 14;
                this.playPanel.bipai_img_left.y = this.playPanel.user_info_0.y + 30;
                this.hideMask(HlszVO.getVo().wChairId_0)
            }
            if (paiUser1 == 1) {
                this.playPanel.bipai_img_left.source = "special_" + HlszVO.getVo().userImg_1 % 15;
                this.playPanel.bipai_img_left.x = this.playPanel.user_info_1.x + 14;
                this.playPanel.bipai_img_left.y = this.playPanel.user_info_1.y + 30;
                this.hideMask(HlszVO.getVo().wChairId_1)
            }
            if (paiUser1 == 2) {
                this.playPanel.bipai_img_left.source = "special_" + GameVO.getVo().wFaceID % 15;
                this.playPanel.bipai_img_left.x = this.playPanel.user_info_2.x + 14;
                this.playPanel.bipai_img_left.y = this.playPanel.user_info_2.y + 30;
                this.hideMask(HlszVO.getVo().wChairId_2)
            }
            if (paiUser1 == 3) {
                this.playPanel.bipai_img_left.source = "special_" + HlszVO.getVo().userImg_3 % 15;
                this.playPanel.bipai_img_left.x = this.playPanel.user_info_3.x + 14;
                this.playPanel.bipai_img_left.y = this.playPanel.user_info_3.y + 30;
                this.hideMask(HlszVO.getVo().wChairId_3)
            }
            if (paiUser1 == 4) {
                this.playPanel.bipai_img_left.source = "special_" + HlszVO.getVo().userImg_4 % 15;
                this.playPanel.bipai_img_left.x = this.playPanel.user_info_4.x + 14;
                this.playPanel.bipai_img_left.y = this.playPanel.user_info_4.y + 30;
                this.hideMask(HlszVO.getVo().wChairId_4)
            }

            if (paiUser2 == 0) {
                this.playPanel.bipai_img_right.source = "special_" + HlszVO.getVo().userImg_0 % 15;
                this.playPanel.bipai_img_right.x = this.playPanel.user_info_0.x + 14;
                this.playPanel.bipai_img_right.y = this.playPanel.user_info_0.y + 30;
                this.hideMask(HlszVO.getVo().wChairId_0)
            }
            if (paiUser2 == 1) {
                this.playPanel.bipai_img_right.source = "special_" + HlszVO.getVo().userImg_1 % 15;
                this.playPanel.bipai_img_right.x = this.playPanel.user_info_1.x + 14;
                this.playPanel.bipai_img_right.y = this.playPanel.user_info_1.y + 30;
                this.hideMask(HlszVO.getVo().wChairId_1)
            }
            if (paiUser2 == 2) {
                this.playPanel.bipai_img_right.source = "special_" + GameVO.getVo().wFaceID % 15;
                this.playPanel.bipai_img_right.x = this.playPanel.user_info_2.x + 14;
                this.playPanel.bipai_img_right.y = this.playPanel.user_info_2.y + 30;
                this.hideMask(HlszVO.getVo().wChairId_2)
            }
            if (paiUser2 == 3) {
                this.playPanel.bipai_img_right.source = "special_" + HlszVO.getVo().userImg_3 % 15;
                this.playPanel.bipai_img_right.x = this.playPanel.user_info_3.x + 14;
                this.playPanel.bipai_img_right.y = this.playPanel.user_info_3.y + 30;
                this.hideMask(HlszVO.getVo().wChairId_3)
            }
            if (paiUser2 == 4) {
                this.playPanel.bipai_img_right.source = "special_" + HlszVO.getVo().userImg_4 % 15;
                this.playPanel.bipai_img_right.x = this.playPanel.user_info_4.x + 14;
                this.playPanel.bipai_img_right.y = this.playPanel.user_info_4.y + 30;
                this.hideMask(HlszVO.getVo().wChairId_4)
            }
            let leftX2 = this.playPanel.bipai_img_left.x;
            let leftY2 = this.playPanel.bipai_img_left.y;
            let rightX2 = this.playPanel.bipai_img_right.x;
            let rightY2 = this.playPanel.bipai_img_right.y;

            this.playPanel.bipai_group.visible = true;
            egret.Tween.get(this.playPanel.bipai_img_left).to({ x: leftX1, y: leftY1 }, 400)
            egret.Tween.get(this.playPanel.bipai_img_right).to({ x: rightX1, y: rightY1 }, 400)
            egret.Tween.get(this.playPanel.bipai_left).wait(400).to({ x: bipai_left_x }, 400)
            egret.Tween.get(this.playPanel.bipai_right).wait(400).to({ x: bipai_right_x }, 400).call(() => {
                var fun = function () {
                    if (paiUser1 == loseUser) {
                        thisBack.playPanel.bipai_state_left.source = "hlzs_lanpai"
                    } else {
                        thisBack.playPanel.bipai_state_right.source = "hlzs_lanpai"
                    }
                    egret.Tween.get(thisBack.playPanel.bipai_img_left).wait(800).to({ x: leftX2, y: leftY2 }, 400)
                    egret.Tween.get(thisBack.playPanel.bipai_img_right).wait(800).to({ x: rightX2, y: rightY2 }, 400)
                    egret.Tween.get(thisBack.playPanel.bipai_left).wait(800).to({ x: - thisBack.playPanel.bipai_left.width }, 500)
                    egret.Tween.get(thisBack.playPanel.bipai_right).wait(800).to({ x: GameConfig.curWidth() }, 500).call(() => {
                        thisBack.playPanel.bipai_group.visible = false;
                        // thisBack.playPanel.bipai_img_left.x = leftX1
                        // thisBack.playPanel.bipai_img_left.y = leftY1
                        // thisBack.playPanel.bipai_img_right.x = rightX1
                        // thisBack.playPanel.bipai_img_right.y = rightY1
                        shouShuPai()
                    })
                }
                var group = new eui.Group()
                var json = RES.getRes("hlsz_bipai_json")
                var text = RES.getRes("hlsz_bipai")
                var mcDataFactory: egret.MovieClipDataFactory = new egret.MovieClipDataFactory(json, text)
                var nodemv: egret.MovieClip = new egret.MovieClip(mcDataFactory.generateMovieClipData())
                if (nodemv) {
                    group.addChild(nodemv);
                    group.horizontalCenter = -210
                    group.verticalCenter = -210
                    thisBack.playPanel.bipai_group.addChild(group)
                    nodemv.addEventListener(egret.Event.COMPLETE, () => {
                        if (nodemv.parent != null) {
                            nodemv.parent.removeChild(nodemv);
                        }
                        fun();
                    }, this)
                    nodemv.play(3);
                    SoundManage.startYinxiaoLoad("hlsz_bipai2_mp3");
                } else {
                    fun()
                }
            }, this)
            //比牌动画end
            var shouShuPai: Function = function () {
                if (loseUser == 2) {
                    thisBack.playPanel.chess_type_2.source = "";//我输牌或者棋牌可能时先看了牌，把牌型清除图片
                }
                //玩家牌状态
                if (thisBack.playPanel["chess_" + loseUser + "_0"].source == "hlzs_pokerBG") {
                    for (let i = 0; i < 3; i++) {
                        thisBack.playPanel["chess_" + loseUser + "_" + i].source = "hlzs_pokerBG_h";
                    }
                }
                thisBack.playPanel["chess_state_" + loseUser].source = "hlzs_state_lose";
                EffectUtils.playDim(thisBack.playPanel["chess_state_" + loseUser])
                thisBack.playPanel["mask_" + loseUser].visible = true;
                //根据胜负更新按钮 
                thisBack.refreshMyButton();
                thisBack.showMask(HlszVO.getVo().wCurrentUser, HlszVO.getVo().cbTimeOutCard)
                //强制比牌返回
                if (HlszVO.getVo().qiangzhibipai == true) {
                    if (HlszVO.getVo().chess_state_2 == 2 || HlszVO.getVo().chess_state_3 == 1) {
                        HlszVO.getVo().qiangzhibipai_userArr.shift();
                        thisBack.kaipai(null)
                    }
                }
            }
            SoundManage.startYinxiaoLoad("hlsz_bipai_mp3");

        }
        //下注返回(下注 加注 开局底注都调这里，下注 加注只区分声音，底注不播声音)
        private genZhuReceive(user = null, num = null) {//开局显示底注需要传参数
            this.initUserInfo();
            this.initRoomInfo();
            let xiazhuUser = user//下注玩家
            let xiazhuNum = num//下注数量
            let xiazhuType = null;//下注类型 1跟注 2 加注 3比牌 4全下
            if (xiazhuUser == null) {
                xiazhuUser = HlszVO.getVo().xiaZhuUser;
                xiazhuNum = HlszVO.getVo().xiazhuNum;
                xiazhuType = HlszVO.getVo().xiazhuType;
                this.refreshMyButton();//底注不刷新按钮状态
                this.hideMask(HlszVO.getVo().wOutCardUser)
                this.showMask(HlszVO.getVo().wCurrentUser, HlszVO.getVo().cbTimeOutCard)
            }
            let beginX, beginY, finishX, finishY;
            if (xiazhuUser == 0) {
                beginX = this.playPanel.user_info_0.x - this.playPanel.jinbi_group.x
                beginY = this.playPanel.user_info_0.y - this.playPanel.jinbi_group.y
                // this.playPanel.xiazhu_0_bg.visible = true
                this.playPanel.xiazhu_0.text = HlszVO.getVo().xiaZhuNum_0 / 100 + ""
            }
            if (xiazhuUser == 1) {
                beginX = this.playPanel.user_info_1.x - this.playPanel.jinbi_group.x
                beginY = this.playPanel.user_info_1.y - this.playPanel.jinbi_group.y
                // this.playPanel.xiazhu_1_bg.visible = true
                this.playPanel.xiazhu_1.text = HlszVO.getVo().xiaZhuNum_1 / 100 + ""
            }
            if (xiazhuUser == 2) {
                beginX = this.playPanel.user_info_2.x - this.playPanel.jinbi_group.x
                beginY = this.playPanel.user_info_2.y - this.playPanel.jinbi_group.y
                // this.playPanel.xiazhu_2_bg.visible = true
                this.playPanel.xiazhu_2.text = HlszVO.getVo().xiaZhuNum_2 / 100 + ""
            }
            if (xiazhuUser == 3) {
                beginX = this.playPanel.user_info_3.x - this.playPanel.jinbi_group.x
                beginY = this.playPanel.user_info_3.y - this.playPanel.jinbi_group.y
                // this.playPanel.xiazhu_3_bg.visible = true
                this.playPanel.xiazhu_3.text = HlszVO.getVo().xiaZhuNum_3 / 100 + ""
            }
            if (xiazhuUser == 4) {
                beginX = this.playPanel.user_info_4.x - this.playPanel.jinbi_group.x
                beginY = this.playPanel.user_info_4.y - this.playPanel.jinbi_group.y
                // this.playPanel.xiazhu_4_bg.visible = true
                this.playPanel.xiazhu_4.text = HlszVO.getVo().xiaZhuNum_4 / 100 + ""
            }
            let chouma = this.qiegeJinbi(xiazhuNum)
            for (let k = 0; k < chouma.length; k++) {
                let xiazhu = chouma[k];
                let img = betImgPool.getFreeObject("bet_" + (xiazhu / 100));
                img.x = beginX;
                img.y = beginY;
                img.width = 64;
                img.height = 64;
                this.playPanel.jinbi_group.addChild(img);
                finishX = this.playPanel.jinbi_fanwei.x + Math.random() * this.playPanel.jinbi_fanwei.width;
                finishY = this.playPanel.jinbi_fanwei.y + Math.random() * this.playPanel.jinbi_fanwei.height;
                egret.Tween.get(img).to({ x: finishX, y: finishY }, 500 + Math.floor(Math.random() * 200), egret.Ease.circOut).call((img: eui.Image) => {
                    egret.Tween.removeTweens(img);
                }, this, [img])
                this.bitImgArr.push(img);
            }
            SoundManage.startYinxiaoLoad("hlsz_bet_mp3")
            if (HlszVO.getVo().xiazhuType != 3) {//比牌下注不播放，因为马上会播放比牌
                if (xiazhuType == 0) {//下注
                    // SoundManage.startYinxiaoLoad("hlsz_genzhu_" + Global.getRandom(0, 2) + "_mp3")
                }
                if (xiazhuType == 1) {//跟注
                    SoundManage.startYinxiaoLoad("hlsz_genzhu_" + Global.getRandom(0, 2) + "_mp3")
                }
                if (xiazhuType == 2) {//加注
                    SoundManage.startYinxiaoLoad("hlsz_jiazhu_" + Global.getRandom(0, 3) + "_mp3");
                }
            }
        }
        //游戏结束
        private gameOver() {
            let thisBack = this;
            let winUser = HlszVO.getVo().winUser;
            var fanpai: Function = (sort, id) => {
                let chessArr: Array<number> = HlszVO.getVo().cbCardDataALL[id];
                let pokerArr = Poker_public.sort(Poker_public.idChangeObject(chessArr))
                //牌处于背面状态或者输牌或者弃牌才能翻， 已经翻过牌了就不在重复翻牌
                if (thisBack.playPanel["chess_" + sort + "_0"].source == "hlzs_pokerBG"
                    || thisBack.playPanel["chess_" + sort + "_0"].source == "hlzs_pokerBG_h") {
                    for (let i = 0; i < 3; i++) {
                        EffectUtils.xuanZuanHuanTu(thisBack.playPanel["chess_" + sort + "_" + i], Global.getPokerById(pokerArr[i].id))
                    }
                    //翻庄家的牌亮出牌型
                    if (id == winUser) {
                        egret.setTimeout(() => {
                            thisBack.playPanel["chess_state_" + sort].source = "";
                            thisBack.playPanel["chess_type_" + sort].source = HlszVO.getVo().cbCardType[id] == 7 ? "hlzs_cardtype1" : "hlzs_cardtype" + HlszVO.getVo().cbCardType[id];
                            EffectUtils.Twinkle(thisBack.playPanel["chess_type_" + sort]);
                        }, this, 700)
                    }
                }
            }
            //自己牌必翻
            //跟我比牌的人要翻
            fanpai(2, HlszVO.getVo().wChairId_2);
            for (let i = 0; i < HlszVO.getVo().PkMeUser.length; i++) {
                if (HlszVO.getVo().PkMeUser[i] == HlszVO.getVo().wChairId_0) {
                    fanpai(0, HlszVO.getVo().PkMeUser[i])
                } else if (HlszVO.getVo().PkMeUser[i] == HlszVO.getVo().wChairId_1) {
                    fanpai(1, HlszVO.getVo().PkMeUser[i])
                } else if (HlszVO.getVo().PkMeUser[i] == HlszVO.getVo().wChairId_3) {
                    fanpai(3, HlszVO.getVo().PkMeUser[i])
                } else if (HlszVO.getVo().PkMeUser[i] == HlszVO.getVo().wChairId_4) {
                    fanpai(4, HlszVO.getVo().PkMeUser[i])
                }
            }

            this.refreshMyButton();
            this.hideMask(HlszVO.getVo().wChairId_4)
            this.hideMask(HlszVO.getVo().wChairId_3)
            this.hideMask(HlszVO.getVo().wChairId_2)
            this.hideMask(HlszVO.getVo().wChairId_1)
            this.hideMask(HlszVO.getVo().wChairId_0)
            var shouFenShu: Function = () => {
                let jinbiX = null;      //赢家收取金币位置
                let jinbiY = null;
                if (winUser == HlszVO.getVo().wChairId_0) {
                    jinbiX = this.playPanel.user_info_0.x + 50;
                    jinbiY = this.playPanel.user_info_0.y + 50;
                }
                if (winUser == HlszVO.getVo().wChairId_1) {
                    jinbiX = this.playPanel.user_info_1.x + 50;
                    jinbiY = this.playPanel.user_info_1.y + 50;
                }
                if (winUser == HlszVO.getVo().wChairId_2) {
                    jinbiX = this.playPanel.user_info_2.x + 50;
                    jinbiY = this.playPanel.user_info_2.y + 50;
                }
                if (winUser == HlszVO.getVo().wChairId_3) {
                    jinbiX = this.playPanel.user_info_3.x + 50;
                    jinbiY = this.playPanel.user_info_3.y + 50;
                }
                if (winUser == HlszVO.getVo().wChairId_4) {
                    jinbiX = this.playPanel.user_info_4.x + 50;
                    jinbiY = this.playPanel.user_info_4.y + 50;
                }
                let num = thisBack.playPanel.jinbi_group.numChildren;
                for (let i = 0; i < num; i++) {
                    egret.Tween.get(thisBack.playPanel.jinbi_group.getChildAt(i)).wait(Math.random() * 300).to({ x: jinbiX, y: jinbiY }, 400).call((img: eui.Image) => {
                        egret.Tween.removeTweens(img)
                        if (thisBack.playPanel.jinbi_group.contains(img)) {
                            thisBack.playPanel.jinbi_group.removeChild(img);
                            betImgPool.returnObject(img)
                        }
                    }, this, [thisBack.playPanel.jinbi_group.getChildAt(i)])
                }
                if (Global.isNotEmpty(HlszVO.getVo().wChairId_0)) {
                    thisBack.playPanel.score_0.text = Global.getmeishufen(HlszVO.getVo().lGameScore[HlszVO.getVo().wChairId_0] / 100)
                    EffectUtils.flyObj(thisBack.playPanel.score_0);
                }
                if (Global.isNotEmpty(HlszVO.getVo().wChairId_1)) {
                    thisBack.playPanel.score_1.text = Global.getmeishufen(HlszVO.getVo().lGameScore[HlszVO.getVo().wChairId_1] / 100)
                    EffectUtils.flyObj(thisBack.playPanel.score_1);
                }
                if (Global.isNotEmpty(HlszVO.getVo().wChairId_3)) {
                    thisBack.playPanel.score_3.text = Global.getmeishufen(HlszVO.getVo().lGameScore[HlszVO.getVo().wChairId_3] / 100)
                    EffectUtils.flyObj(thisBack.playPanel.score_3);
                }
                if (Global.isNotEmpty(HlszVO.getVo().wChairId_4)) {
                    thisBack.playPanel.score_4.text = Global.getmeishufen(HlszVO.getVo().lGameScore[HlszVO.getVo().wChairId_4] / 100)
                    EffectUtils.flyObj(thisBack.playPanel.score_4);
                }
                thisBack.playPanel.score_2.text = Global.getmeishufen(HlszVO.getVo().lGameScore[HlszVO.getVo().wChairId_2] / 100)
                EffectUtils.flyObj(thisBack.playPanel.score_2);
            }
            let t = egret.setTimeout(() => {
                shouFenShu();
                egret.clearTimeout(t);
            }, this, 500)
            //倒计时一段时间后提示准备
            this.timeOutArr.push(egret.setTimeout(() => {
                SoundManage.startYinxiaoLoad("hlsz_ready_mp3")
            }, this, 3000)
            )
        }
        //中途加入
        private dataRecovery() {
            this.initRoomInfo();
            this.playPanel.xiazhu_all.text = HlszVO.getVo().xiazhuNum_ALL / 100 + ""
            let fapaiXY = this.fapaiXY;
            //恢复下注数
            if (Global.isNotEmpty(HlszVO.getVo().wChairId_0)) {
                // this.playPanel.xiazhu_0_bg.visible = true
                this.playPanel.xiazhu_0.text = HlszVO.getVo().xiaZhuNum_0 / 100 + ""
                for (let i = 0; i < 3; i++) {
                    this.playPanel["chess_0_" + i].source = "hlzs_pokerBG";
                    this.playPanel["chess_0_" + i].x = fapaiXY[0].x + i * 50
                    this.playPanel["chess_0_" + i].y = fapaiXY[0].y
                }
                if (HlszVO.getVo().chess_state_0 == 2) {
                    this.playPanel.chess_state_0.source = "hlzs_state_kanpai";
                }
                if (HlszVO.getVo().chess_state_0 == 3) {
                    this.playPanel.chess_state_0.source = "hlzs_state_qipai";
                    for (let i = 0; i < 3; i++) {
                        this.playPanel["chess_0_" + i].source = "hlzs_pokerBG_h";
                    }
                    this.playPanel.mask_0.visible = true;
                }
                if (HlszVO.getVo().chess_state_0 == 4) {
                    this.playPanel.chess_state_0.source = "hlzs_state_lose";
                    for (let i = 0; i < 3; i++) {
                        this.playPanel["chess_0_" + i].source = "hlzs_pokerBG_h";
                    }
                    this.playPanel.mask_0.visible = true;
                }

            }
            if (Global.isNotEmpty(HlszVO.getVo().wChairId_1)) {
                // this.playPanel.xiazhu_1_bg.visible = true
                this.playPanel.xiazhu_1.text = HlszVO.getVo().xiaZhuNum_1 / 100 + ""
                for (let i = 0; i < 3; i++) {
                    this.playPanel["chess_1_" + i].source = "hlzs_pokerBG";
                    this.playPanel["chess_1_" + i].x = fapaiXY[1].x + i * 50
                    this.playPanel["chess_1_" + i].y = fapaiXY[1].y
                }
                if (HlszVO.getVo().chess_state_1 == 2) {
                    this.playPanel.chess_state_1.source = "hlzs_state_kanpai";
                }
                if (HlszVO.getVo().chess_state_1 == 3) {
                    this.playPanel.chess_state_1.source = "hlzs_state_qipai";
                    for (let i = 0; i < 3; i++) {
                        this.playPanel["chess_1_" + i].source = "hlzs_pokerBG_h";
                    }
                    this.playPanel.mask_1.visible = true;
                }
                if (HlszVO.getVo().chess_state_1 == 4) {
                    this.playPanel.chess_state_1.source = "hlzs_state_lose";
                    for (let i = 0; i < 3; i++) {
                        this.playPanel["chess_1_" + i].source = "hlzs_pokerBG_h";
                    }
                    this.playPanel.mask_1.visible = true;
                }
            }
            if (Global.isNotEmpty(HlszVO.getVo().wChairId_3)) {
                // this.playPanel.xiazhu_3_bg.visible = true
                this.playPanel.xiazhu_3.text = HlszVO.getVo().xiaZhuNum_3 / 100 + ""
                for (let i = 0; i < 3; i++) {
                    this.playPanel["chess_3_" + i].source = "hlzs_pokerBG";
                    this.playPanel["chess_3_" + i].x = fapaiXY[3].x + i * 50
                    this.playPanel["chess_3_" + i].y = fapaiXY[3].y
                }
                if (HlszVO.getVo().chess_state_3 == 2) {
                    this.playPanel.chess_state_3.source = "hlzs_state_kanpai";
                }
                if (HlszVO.getVo().chess_state_3 == 3) {
                    this.playPanel.chess_state_3.source = "hlzs_state_qipai";
                    for (let i = 0; i < 3; i++) {
                        this.playPanel["chess_3_" + i].source = "hlzs_pokerBG_h";
                    }
                    this.playPanel.mask_3.visible = true;
                }
                if (HlszVO.getVo().chess_state_3 == 4) {
                    this.playPanel.chess_state_3.source = "hlzs_state_lose";
                    for (let i = 0; i < 3; i++) {
                        this.playPanel["chess_3_" + i].source = "hlzs_pokerBG_h";
                    }
                    this.playPanel.mask_3.visible = true;
                }
            }
            if (Global.isNotEmpty(HlszVO.getVo().wChairId_4)) {
                // this.playPanel.xiazhu_4_bg.visible = true
                this.playPanel.xiazhu_4.text = HlszVO.getVo().xiaZhuNum_4 / 100 + ""
                for (let i = 0; i < 3; i++) {
                    this.playPanel["chess_4_" + i].source = "hlzs_pokerBG";
                    this.playPanel["chess_4_" + i].x = fapaiXY[4].x + i * 50
                    this.playPanel["chess_4_" + i].y = fapaiXY[4].y
                }
                if (HlszVO.getVo().chess_state_4 == 2) {
                    this.playPanel.chess_state_4.source = "hlzs_state_kanpai";
                }
                if (HlszVO.getVo().chess_state_4 == 3) {
                    this.playPanel.chess_state_4.source = "hlzs_state_qipai";
                    for (let i = 0; i < 3; i++) {
                        this.playPanel["chess_4_" + i].source = "hlzs_pokerBG_h";
                    }
                    this.playPanel.mask_4.visible = true;
                }
                if (HlszVO.getVo().chess_state_4 == 4) {
                    this.playPanel.chess_state_4.source = "hlzs_state_lose";
                    for (let i = 0; i < 3; i++) {
                        this.playPanel["chess_4_" + i].source = "hlzs_pokerBG_h";
                    }
                    this.playPanel.mask_4.visible = true;
                }
            }
            if (HlszVO.getVo().xiaZhuNum_2 != 0) {
                this.playPanel.xiazhu_2_bg.visible = true
                this.playPanel.xiazhu_2.text = HlszVO.getVo().xiaZhuNum_2 / 100 + ""
                for (let i = 0; i < 3; i++) {
                    this.playPanel["chess_2_" + i].source = "hlzs_pokerBG";
                    this.playPanel["chess_2_" + i].x = fapaiXY[2].x + i * 50
                    this.playPanel["chess_2_" + i].y = fapaiXY[2].y
                }
                if (HlszVO.getVo().chess_state_2 == 2) {
                    this.playPanel.chess_state_2.source = "hlzs_state_kanpai";
                }
                if (HlszVO.getVo().chess_state_2 == 3) {
                    this.playPanel.chess_state_2.source = "hlzs_state_qipai";
                    for (let i = 0; i < 3; i++) {
                        this.playPanel["chess_2_" + i].source = "hlzs_pokerBG_h";
                    }
                    this.playPanel.mask_2.visible = true;
                }
                if (HlszVO.getVo().chess_state_2 == 4) {
                    this.playPanel.chess_state_2.source = "hlzs_state_lose";
                    for (let i = 0; i < 3; i++) {
                        this.playPanel["chess_2_" + i].source = "hlzs_pokerBG_h";
                    }
                    this.playPanel.mask_2.visible = true;
                }
            }
            let betArr = this.qiegeJinbi(HlszVO.getVo().xiazhuNum_ALL);
            for (let y in betArr) {
                let img = betImgPool.getFreeObject("bet_" + (betArr[y] / 100))
                img.x = this.playPanel.jinbi_fanwei.x + Math.random() * this.playPanel.jinbi_fanwei.width;
                img.y = this.playPanel.jinbi_fanwei.y + Math.random() * this.playPanel.jinbi_fanwei.height;
                img.width = 50;
                img.height = 50;
                this.playPanel.jinbi_group.addChild(img);
                this.bitImgArr.push(img);
            }

            this.refreshMyButton();
        }
        //玩家金币剩余和房间轮数
        public modifyUserAndRoomInfo() {
            this.initUserInfo();
            this.initRoomInfo();
        }
        //刷新我的操作按钮
        private refreshMyButton() {
            //如果上次是我操作，无论操作什么都应该关闭加注界面
            if (HlszVO.getVo().wOutCardUser == HlszVO.getVo().wChairId_2) {
                this.refreshJiaZhu();
            }
            this.playPanel.button_gendaodi.enabled = true;
            this.playPanel.button_qipai.enabled = false;
            this.playPanel.button_kanpai.enabled = false;
            this.playPanel.button_bipai.enabled = false;
            this.playPanel.button_jiazhu.enabled = false;
            this.playPanel.button_genzhu.enabled = false;
            if (HlszVO.getVo().winUser != null) {                                       //游戏已结束
                return;
            }
            if (HlszVO.getVo().chess_state_2 == 3 || HlszVO.getVo().chess_state_2 == 4) {//已经输了就没你事儿了
                this.gendaodi = false;
                this.playPanel.button_gendaodi.enabled = false;
                this.playPanel.button_gendaodi2.visible = false;
                return;
            }
            if (HlszVO.getVo().chess_state_2 == 1 || HlszVO.getVo().chess_state_2 == 2) {//闷牌和看牌 状态可弃牌
                this.playPanel.button_qipai.enabled = true;
            }
            //以上操作跟余额不相关,且随时可操作

            //以下按钮根据余额决定是否显示，且必须轮到我才能操作
            /**
             * 轮到我说话的时候：
             * 未看牌      可以看牌
             * 够下注：    可以下注
             *            可以比牌
             *            可以加注
            */
            if (HlszVO.getVo().wCurrentUser == HlszVO.getVo().wChairId_2) {
                if (HlszVO.getVo().chess_state_2 == 1 && HlszVO.getVo().wTurnCount > 1) {  //闷牌状态可看牌
                    this.playPanel.button_kanpai.enabled = true;
                }
                let num = HlszVO.getVo().lCellScore * HlszVO.getVo().lCurrentTimes
                if (HlszVO.getVo().chess_state_2 == 2) {
                    num = num * 2
                }

                //有钱的情况
                if (HlszVO.getVo().lUserScore > num) {
                    if (HlszVO.getVo().wTurnCount > 1) {                              //第2轮开始可以比牌
                        this.playPanel.button_bipai.enabled = true;
                    }
                    if (HlszVO.getVo().lCurrentTimes < 10) {     //未封顶 可以加注
                        this.playPanel.button_jiazhu.enabled = true;
                    }
                    //可以跟注
                    this.playPanel.button_genzhu.enabled = true;
                    this.playPanel.button_gendaodi.enabled = true;
                    if (this.gendaodi && HlszVO.getVo().wTurnCount < 21) {          //勾选了跟到底则自动跟注
                        this.playPanel.button_kanpai.enabled = false;
                        this.playPanel.button_gendaodi2.visible = true;
                        this.genZhuSend();
                    }
                } else {
                    //钱不够了关闭自动跟注
                    this.gendaodi = false;
                    this.playPanel.button_gendaodi.enabled = false;
                    this.playPanel.button_gendaodi2.visible = false;
                    //钱不够了强制比牌
                    if (HlszVO.getVo().qiangzhibipai == false) {
                        HlszVO.getVo().qiangzhibipai = true;
                        if (Global.isNotEmpty(HlszVO.getVo().wChairId_3) && (HlszVO.getVo().chess_state_3 == 2 || HlszVO.getVo().chess_state_3 == 1)) {
                            HlszVO.getVo().qiangzhibipai_userArr.push(HlszVO.getVo().wChairId_3);
                        }
                        if (Global.isNotEmpty(HlszVO.getVo().wChairId_4) && (HlszVO.getVo().chess_state_4 == 2 || HlszVO.getVo().chess_state_4 == 1)) {
                            HlszVO.getVo().qiangzhibipai_userArr.push(HlszVO.getVo().wChairId_4);
                        }
                        if (Global.isNotEmpty(HlszVO.getVo().wChairId_0) && (HlszVO.getVo().chess_state_0 == 2 || HlszVO.getVo().chess_state_0 == 1)) {
                            HlszVO.getVo().qiangzhibipai_userArr.push(HlszVO.getVo().wChairId_0);
                        }
                        if (Global.isNotEmpty(HlszVO.getVo().wChairId_1) && (HlszVO.getVo().chess_state_1 == 2 || HlszVO.getVo().chess_state_1 == 1)) {
                            HlszVO.getVo().qiangzhibipai_userArr.push(HlszVO.getVo().wChairId_1);
                        }
                        this.playPanel.button_bipai.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.biPaiClick, this);
                        this.playPanel.button_bipai.addEventListener(egret.TouchEvent.TOUCH_TAP, this.kaipai, this);
                        this.playPanel.button_bipai.enabled = true;
                        EffectUtils.textFadeAway("携带金币不足，强制开牌");
                    }
                }
                //到了21轮强制开牌
                if (HlszVO.getVo().wTurnCount >= 21) {
                    EffectUtils.textFadeAway("已达到本局20轮上限，进行强制比牌");
                    SocketManager.sendMessage(InstructionsEnum.GAME_TYPE_NAME.HLSZ, RegDataHlsz.CMD_GP_OpenCard, { wCompareUser: 0 });//这个参数随便乱发后端不用
                }

            }
        }

        private kaipai(eve: egret.TouchEvent) {
            if (eve != null) {//玩家第一次点开牌时要先下注，之后程序自动发起开牌不需要再次下注
                let obj = {
                    lScore: HlszVO.getVo().lUserScore,						//下注数目
                    wState: 1,							//1-比牌下注 0-普通下注
                    keyToken: ""                     //密文
                }
                SocketManager.sendMessage(InstructionsEnum.GAME_TYPE_NAME.HLSZ, RegDataHlsz.CMD_GP_AddScore, obj);
            } else {
                if (HlszVO.getVo().qiangzhibipai_userArr.length != 0) {
                    var obj = {
                        wCompareUser: HlszVO.getVo().qiangzhibipai_userArr[0]
                    }
                    SocketManager.sendMessage(InstructionsEnum.GAME_TYPE_NAME.HLSZ, RegDataHlsz.CMD_GP_OpenCard, obj);
                }
            }
        }

        //点击下拉菜单
        private menu_click() {
            if (this.playPanel.menu_button.name == "on") {//收起菜单
                egret.Tween.removeTweens(this.playPanel.menu_button)
                egret.Tween.removeTweens(this.playPanel.menu_group)
                this.playPanel.menu_button.name = "off"
                egret.Tween.get(this.playPanel.menu_button).to({ rotation: 0 }, 300)
                egret.Tween.get(this.playPanel.menu_group).to({ x: -260 }, 300).call((menu_group: eui.Group) => {
                    menu_group.visible = false;
                }, this, [this.playPanel.menu_group])
            } else {                                      //弹出菜单
                egret.Tween.removeTweens(this.playPanel.menu_button)
                egret.Tween.removeTweens(this.playPanel.menu_group)
                this.playPanel.menu_button.name = "on"
                this.playPanel.menu_group.visible = true;
                egret.Tween.get(this.playPanel.menu_button).to({ rotation: 90 }, 300)
                egret.Tween.get(this.playPanel.menu_group).to({ x: 0 }, 300)
            }
        }
        //离开游戏
        private onBackClick() {
            SoundManage.startAnniuBtnLoad();
            this.menu_click();
            if (HlszVO.getVo().chess_state_2 == 1 || HlszVO.getVo().chess_state_2 == 2) {//闷排看牌状态不准走
                let obj = new Object();
                obj[InstructionsEnum.TEXT] = "请等待游戏结束后离开！";
                game.AppFacade.instance.sendNotification(PanelNotify.HALL.OPEN_TIP, obj);
            } else {
                let obj = new Object();
                obj[InstructionsEnum.CODE] = PanelNotify.HLSZ.CLOSE_PLAY_GAME;
                obj[InstructionsEnum.TEXT] = "确定要离开游戏吗？";
                game.AppFacade.instance.sendNotification(PanelNotify.HALL.OPEN_TIP, obj);
            }
        }
        //打开设置
        private onSettingClick(): void {
            SoundManage.startAnniuBtnLoad();
            this.menu_click();
            game.AppFacade.instance.sendNotification(PanelNotify.HALL.OPEN_SETTING);
        }
        //打开帮助
        private onHelpClick() {
            SoundManage.startAnniuBtnLoad();
            this.menu_click();
            game.AppFacade.instance.sendNotification(PanelNotify.HALL.OPEN_HELP_HLSZ);
        }
        //点击反馈
        private fankuiClick() {
            SoundManage.startAnniuBtnLoad();
            this.menu_click();
            game.AppFacade.instance.sendNotification(PanelNotify.HALL.OPEN_FANKUI, InstructionsEnum.GAME_TYPE_NAME.HLSZ)
        }
        //点击记录
        private jiluClick() {
            SoundManage.startAnniuBtnLoad();
            this.menu_click();
            var obj = {
                gameType: InstructionsEnum.GAME_TYPE_NAME.HLSZ,
                roomType: InstructionsEnum.LEVEL_GAME
            }
            game.AppFacade.instance.sendNotification(PanelNotify.HALL.OPEN_JILU, JSON.stringify(obj))
        }
        //显示玩家的头像倒计时
        private showMask(user: number, time: number) {
            this.hideMask(user);
            if (user == HlszVO.getVo().wChairId_0) {
                this.playPanel.timeout_0.init(time)
            }
            if (user == HlszVO.getVo().wChairId_1) {
                this.playPanel.timeout_1.init(time)
            }
            if (user == HlszVO.getVo().wChairId_2) {
                this.playPanel.timeout_2.init(time)
            }
            if (user == HlszVO.getVo().wChairId_3) {
                this.playPanel.timeout_3.init(time)
            }
            if (user == HlszVO.getVo().wChairId_4) {
                this.playPanel.timeout_4.init(time)
            }
        }
        //隐藏玩家的头像转圈
        private hideMask(user: number) {
            if (user == HlszVO.getVo().wChairId_0) {
                this.playPanel.timeout_0.destroy()
            }
            if (user == HlszVO.getVo().wChairId_1) {
                this.playPanel.timeout_1.destroy()
            }
            if (user == HlszVO.getVo().wChairId_2) {
                this.playPanel.timeout_2.destroy()
            }
            if (user == HlszVO.getVo().wChairId_3) {
                this.playPanel.timeout_3.destroy()
            }
            if (user == HlszVO.getVo().wChairId_4) {
                this.playPanel.timeout_4.destroy()
            }
        }
        //金币拆分
        private qiegeJinbi(fen: number): Array<any> {
            let Fen = fen
            let imgList: Array<any> = [];
            let guigeList = this.bet_chip;
            for (let j = guigeList.length - 1; j >= 0; j--) {
                let len = Math.floor(Fen / guigeList[j]);
                if (len != 0) {
                    for (var k = 0; k < len; k++) {
                        imgList.push(guigeList[j]);
                        Fen -= guigeList[j];
                    }
                }
            }
            return imgList
        }
        //下一局准备倒计时
        public nextGameTimeout() {
            if (this.NextGameTime == null) {
                this.playPanel.timeout_2.init(HlszVO.getVo().cbTimeOutExitGame)
                this.NextGameTime = egret.setTimeout(() => {
                    if (Global.isNotEmpty(HlszVO.getVo().wTableId_2) && Global.isNotEmpty(HlszVO.getVo().wChairId_2)) {
                        let data = {
                            wTableID: HlszVO.getVo().wTableId_2,
                            wChairID: HlszVO.getVo().wChairId_2,
                            cbForceLeave: 1
                        }
                        SocketManager.sendMessage(InstructionsEnum.GAME_TYPE_NAME.HLSZ, RegDataGamePublic.CMD_GP_LeaveGame, data, true);
                    }
                    egret.clearTimeout(this.NextGameTime)
                    this.NextGameTime = null;
                }, this, HlszVO.getVo().cbTimeOutExitGame * 1000)
                InstructionsEnum.GAME_TIMEOUT_LIST.push(this.NextGameTime)
            }
        }
    }
}




